<template>
  <div id="app">
    <!--导航栏-->
    <div class="header_content" style=""><Header></Header></div>
    <!--   主体部分 -->
    <div class="body_content">
      <div class="body_left">
        <!-- 表1 -->
        <div class="table">
          <div class="body_title">企业信息</div>
          <el-table :data="tableData.slice((currentPage - 1) * pageSize, currentPage * pageSize)" width="850px"  border style="margin-left: 10px;height: 530px">
            <el-table-column prop="id" label="公司编号" width="100"></el-table-column>
            <el-table-column prop="name" label="公司名称" width="218"></el-table-column>
            <el-table-column prop="boss" label="法人代表" width="100"></el-table-column>
            <el-table-column prop="money" label="注册资本" width="160"></el-table-column>
            <el-table-column prop="phone" label="联系电话" width="150"></el-table-column>
            <el-table-column prop="adress" label="公司注册地址" width="120"></el-table-column>
          </el-table>
          <div class="pag" style="float: left;margin-top: 10px">
            <el-pagination
              background
              @size-change="handleSizeChange"
              @current-change="handleCurrentChange"
              :current-page="currentPage"
              :page-size="pageSize"
              layout="total, prev, pager, next"
              :total="tableData.length"
            ></el-pagination>
          </div>
        </div>
        <!-- /表1 -->
        <!-- 底部广告 -->
        <div class="bottom-adv" />
        <!-- /底部广告 -->
      </div>
      <div class="body_right"><div class="img1" /></div>
    </div>

    <!--footer -->
    <!--脚页-->
    <footer data-v-05f63236="" data-v-e69431de="" id="aqc-footer" class="footer">
      <div data-v-05f63236="" class="footer-content">
        <div data-v-05f63236="" class="box company">
          <h3 data-v-05f63236="" class="title">爱企查</h3>
          <p data-v-05f63236="">
            <a data-v-05f63236="" href="/fs/about" target="_blank">关于我们</a>
            <a data-v-05f63236="" href="/fs/protocol" target="_blank">用户协议</a>
            <a data-v-05f63236="" href="https://www.baidu.com/duty/" target="_blank">免责声明</a>
          </p>
        </div>
        <div data-v-05f63236="" class="box ours">
          <h3 data-v-05f63236="" class="title">联系我们</h3>
          <p data-v-05f63236="" class="content">
            <i data-v-05f63236="" class="icon ivu-icon ivu-icon-ios-mail-outline" style="font-size: 20px;"></i>
            用户反馈：
            <span data-v-05f63236="" class="user-feedback-btn">点此反馈</span>
          </p>
          <p data-v-05f63236="" class="content">
            <i data-v-05f63236="" class="icon icon-cooperation"></i>
            商务合作：bd-aiqicha@baidu.com
          </p>
        </div>
        <div data-v-05f63236="" class="box source">
          <h3 data-v-05f63236="" class="title">数据来源</h3>
          <p data-v-05f63236="" class="content">
            <span data-v-05f63236="">国家企业信用信息公示系统</span>
            <span data-v-05f63236="">信用中国</span>
            <span data-v-05f63236="">中国裁判文书网</span>
          </p>
          <p data-v-05f63236="" class="content">
            <span data-v-05f63236="">中国执行信息公开网</span>
            <span data-v-05f63236="">国家知识产权局</span>
            <span data-v-05f63236="">商标局</span>
          </p>
          <p data-v-05f63236="" class="content">
            <span data-v-05f63236="">版权局</span>
            <span data-v-05f63236="">上海合合信息科技发展有限公司</span>
            <span data-v-05f63236="">民政部</span>
          </p>
        </div>
      </div>
      <p data-v-05f63236="" class="tip">
        <a data-v-05f63236="" href="https://beian.miit.gov.cn" target="_blank">京ICP证030173号</a>
        京网文|2013|0934-983号 Copyright ©2021 Baidu
      </p>
      <div data-v-a947a1ba="" data-v-05f63236=""><!----></div>
    </footer>
  </div>
</template>

<script>
import Header from '../components/Header';
import Footer from '../components/Footer';
export default {
  name: 'Search',
  components: {
    Header,
    Footer
  },
  data() {
    return {
      currentPage: 1, //初始页
      pageSize: 10, //    每页的数据
      arr: ['女', '男'],
      tableData: [{}] /*查询所有用户*/,
      User: {},
      d: {} /*查询单个用户*/,
      dialogTableVisible: false,
      dialogFormVisible: false,
      updateFormVisible: false,
      formLabelWidth: '120px'
    };
  },
  methods: {
    // 初始页currentPage、初始每页数据数pagesize和数据data
    handleSizeChange: function(size) {
      this.pagesize = size;
      console.log(this.pagesize); //每页下拉显示数据
    },
    handleCurrentChange: function(currentPage) {
      this.currentPage = currentPage;
      console.log(this.currentPage); //点击第几页
    },

    /*颜色*/
    tableRowClassName({ row, rowIndex }) {
      if (rowIndex === 1) {
        return 'warning-row';
      } else if (rowIndex === 3) {
        return 'success-row';
      }
      return '';
    },

    /*模糊查询所有公司信息*/
    selectInfo(title){
      console.log(title)
      let _this = this
      this.$axios.post("http://localhost:8087/company/selectInfo/"+title).then(function(res){
        if(res.data.length<=0){
          alert('无数据，请重新查询');
          _this.$router.push({name:'Index'})
        }else{
          console.log('查询到的数据'+res.data)
          _this.tableData = res.data
        }
      }).catch(function (err) {
        alert('查询失败')
      })
    }
  },
  created() {
    this.selectInfo(this.$route.params.title)
  }
};
</script>

<style scoped>
.header_content {
  width: 100%;
  height: 74px;
  background-color: #1c52e4;
  box-shadow: 1px 1px 10px #eaeaea;
  /*position: fixed;*/
}

.img_logo {
  float: left;
  width: 130px;
  height: 43px;
  margin-left: 165px;
  margin-top: 16px;
}

.link_a a {
  margin-left: 5px;
  margin-right: 10px;
  text-overflow: ellipsis;
  text-decoration: none;
  outline: none;

  color: #333;
  background: transparent;
  cursor: pointer;
  transition: color 0.1s ease;
}

a:hover {
  color: #2d8cf0;
}

/*footer*/
.footer[data-v-05f63236] {
  /*position: absolute;*/
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  background: #141a25;
  color: #fff;
  font-size: 14px;
  overflow: hidden;
}

.footer-content[data-v-05f63236] {
  overflow: hidden;
  min-width: 1200px;
  box-sizing: border-box;
  padding: 48px 0 24px;
  width: 1200px;
  margin: 0 auto;
}

.footer-content[data-v-05f63236] {
  overflow: hidden;
  min-width: 1200px;
  box-sizing: border-box;
  padding: 48px 0 24px;
  width: 1200px;
  margin: 0 auto;
}

.title[data-v-05f63236] {
  opacity: 1;
  margin-bottom: 24px;
}

.box p[data-v-05f63236] {
  opacity: 0.6;
}

.box a[data-v-05f63236] {
  color: #fff;
  margin: 0 32px 24px 0;
  display: inline-block;
}

a,
a:hover {
  text-decoration: none;
}

a {
  outline: none;
}

a {
  color: #333;
  background: transparent;
  cursor: pointer;
  transition: color 0.1s ease;
}

a {
  background-color: transparent;
  -webkit-text-decoration-skip: objects;
}

a {
  color: #2d8cf0;
  background: 0 0;
  outline: 0;
  -webkit-transition: color 0.2s ease;
  transition: color 0.2s ease;
}

.box[data-v-05f63236] {
  width: 33%;
  float: left;
  overflow: hidden;
}

.title[data-v-05f63236] {
  opacity: 1;
  margin-bottom: 24px;
}

.box p[data-v-05f63236] {
  opacity: 0.6;
}

.content[data-v-05f63236] {
  margin-bottom: 14px;
}

.box p[data-v-05f63236] {
  opacity: 0.6;
}

.content[data-v-05f63236] {
  margin-bottom: 14px;
}

.icon.icon-cooperation[data-v-05f63236] {
  vertical-align: -3px;
  color: hsla(0, 0%, 100%, 0.7);
  font-size: 16px;
  margin-right: 10px;
}

.icon[data-v-05f63236] {
  vertical-align: -4px;
  margin-right: 8px;
}

[class*=' icon-'],
[class^='icon-'] {
  font-family: icomoon !important;
  font-style: normal;
  font-weight: 400;
  font-variant: normal;
  text-transform: none;
  line-height: 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.box[data-v-05f63236] {
  width: 33%;
  float: left;
  overflow: hidden;
}

.title[data-v-05f63236] {
  opacity: 1;
  margin-bottom: 24px;
}

.box p[data-v-05f63236] {
  opacity: 0.6;
}

.content[data-v-05f63236] {
  margin-bottom: 14px;
}

.content span[data-v-05f63236] {
  margin-right: 24px;
}

.content span[data-v-05f63236] {
  margin-right: 24px;
}

.tip[data-v-05f63236] {
  opacity: 0.4;
  width: 1200px;
  margin: 0 auto;
  border-top: 1px solid hsla(0, 0%, 100%, 0.4);
  padding: 24px 0;
  text-align: center;
}

.tip a[data-v-05f63236] {
  color: #fff;
}

.body_content {
  display: flex;
  width: 92%;
  height: 1000px;
  background-color: #ffffff;
  margin-left: 50px;
  margin-top: 40px;
  margin-bottom: 50px;
  box-shadow: 5px 5px 13px #9d9fa6;
}
.body_left {
  width: 860px;
}
.table {
  margin-top: 50px;
}
.bottom-adv{
  margin-top: 100px;
  margin-left: 20px;
  width: 1200px;
  height: 150px;
  background-image: url(../assets/bottom-banner.jpg);
  background-size: 100%;
}
.body_title {
  font-size: 20px;
  font-weight: bold;
  width: 100%;
  height: 30px;
  margin-bottom: 20px;
  margin-left: 400px;
}
/deep/ .el-table {
  width: 850px;
}
.body_right {
  display: flex;
  margin-top: 55px;
  width: 342px;
  margin-left: 20px;

}
.img1 {
  width: 400px;
  height: 420px;
  background-image: url(../assets/gg1.png);
  background-size: 100%;
}

.fate-image-container .color-2 {
  background-color: #c8b7d8;
}
.fate-image-container .txt-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  overflow: hidden;
  text-align: center;
  background: #fff;
  background-color: rgb(255, 255, 255);
  white-space: pre-wrap;
}
.txt-word-4 {
  color: #fff;
  font-weight: 700;
  font-size: 16px;
  line-height: 20px;
  padding: 2px;
}
</style>
